package com.gusti.turnos.model;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import com.gusti.turnos.persistence.model.AbstractModelObject;

/**
 * 
 * @author gusti
 *
 */
@Entity
@Table( uniqueConstraints={ @UniqueConstraint(columnNames={"name"}) } )
public class Appointment extends AbstractModelObject {

	private static final long serialVersionUID = -4945858430092403396L;

	//PROPERTIES
	private String name;
	private Date fromHour;
	private Date toHour;

	//MODIFIERS
	@Basic(optional=false)
	@Column(nullable=false)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@Basic(optional=false)
	@Temporal(TemporalType.TIME)
	@Column(nullable=false)
	public Date getFromHour() {
		return fromHour;
	}
	public void setFromHour(Date fromHour) {
		this.fromHour = fromHour;
	}

	@Basic(optional=false)
	@Temporal(TemporalType.TIME)
	@Column(nullable=false)
	public Date getToHour() {
		return toHour;
	}
	public void setToHour(Date toHour) {
		this.toHour = toHour;
	}

	//OTHERS
}
